package models

import "gorm.io/gorm"

type House struct {
	gorm.Model
	Title   string  `gorm:"type:varchar(40);not null;comment:房屋名称"`
	Size    float64 `gorm:"type:decimal(10,2);not null;comment:面积"`
	Cate    string  `gorm:"type:varchar(40);not null;comment:户型"`
	Price   float64 `gorm:"type:decimal(10,2);not null;comment:价格"`
	Address string  `gorm:"type:varchar(40);not null;comment:地址"`
	UserId  int64   `gorm:"type:int(11);not null;comment:用户id"`
}

func (h *House) ShowHouse() error {
	return DB.Debug().Where("id = ?", h.ID).Find(&h).Error
}
